package com.nbjtjc.safe.api.sys;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.nbjtjc.safe.bean.Page;
import com.nbjtjc.safe.bean.Result;
import com.nbjtjc.safe.mapper.sys.SysLogEntityMapper;
import com.nbjtjc.safe.model.sys.SysLogEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Example;

/**
 * 系统日志
 */
@RestController
@CrossOrigin("*")
@RequestMapping("/sys/log")

public class SysLogController {
    @Autowired
    private SysLogEntityMapper sysLogEntityMapper;


    @RequestMapping(value = "/find",method = {RequestMethod.POST})
    public Result find(SysLogEntity sysLogEntity,Page page){
        Result result=new Result();
        PageHelper.startPage(page.getPageCurrent(),page.getPageSize());
        result.setData(new PageInfo<>(sysLogEntityMapper.search(sysLogEntity,page)));
        return result;
    }
}
